package com.cx.util.wjr;

import static com.cx.util.wjr.GetDistance.getDistance;
import static com.cx.util.wjr.GetDistance.getLonLat;

public class PriceSelect {
//    public static void main(String[] args){
//        String start = "黑龙江省黑河市北安市赵光";
//        String end = "山西省太原市";
//        String startLonLat = getLonLat(start);
//        String endLonLat = getLonLat(end);
//        System.out.println(startLonLat);
//        System.out.println(endLonLat);
//        Long dis = getDistance(startLonLat,endLonLat);
//        System.out.println("两点间距离："+dis+"米");
//        int firstMoney = 5;
//        int Continuation = 3;
//        int money1 = (int) (dis/350000);
//        int money2 = (int) (dis/500000);
//        firstMoney =firstMoney+ money1;
//        Continuation =Continuation+ money2;
//        System.out.println("首重价格="+firstMoney);
//        System.out.println("续重价格="+Continuation);
//        int sum = firstMoney +Continuation;
//        System.out.println("总价格="+(firstMoney +Continuation));
//    }
    public static int  selectPrice(String start,String end,String weight){
        System.out.println(end);
        System.out.println(start);
        String startLonLat = getLonLat(start);
        String endLonLat = getLonLat(end);
        Long dis = getDistance(startLonLat,endLonLat);
        int firstMoney = firstMoney(dis);
        int continuation = Continuation(dis);
        int a = Integer.parseInt(weight);
        int sum = firstMoney + (continuation * (Integer.parseInt(weight)-1));
        return sum;
    }

    public static int  selectPrice(String end,String weight){
        String endLonLat = getLonLat(end);
        return 1;
    }

    public static int firstMoney(Long dis){
        int firstMoney = 5;
        int money1 = (int) (dis/350000);
        firstMoney =firstMoney+ money1;
        return firstMoney;
    }

    public static int Continuation(Long dis){
        int Continuation = 3;
        int money2 = (int) (dis/500000);
        Continuation =Continuation+ money2;
        return Continuation;
    }
}
